<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:c="http://java.sun.com/jsp/jstl/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:sinox="http://www.sinosoft.com.cn/sinox"
	xmlns:p="http://primefaces.org/ui">
	
	<ui:decorate template="/layout/input/editable-template.xhtml">
		<!-- 第一行 -->
		<ui:decorate template="/layout/input/editable-2c-custom-template.xhtml">
			<ui:param name="compBean1Id" value="type" />
			<ui:param name="compBean1Lable" value="事件类别" />
			
			<ui:define name="compBean1Content">
				<sinox:selectOneMenu id="#{compBean1Id}" value="#{eventObject.type}"
					onchange="#{commonContentViewBean.id}_eventObject_#{evt_stat.index}_change('#{commonContentViewBean.id},#{evt_stat.index}')"
					items="#{bpmSelectItemsService.items.eventDefineType}" />
			</ui:define>
		</ui:decorate>
		
		<!-- 第二行 -->
		<ui:decorate template="/layout/input/editable-2c-custom-template.xhtml">
			<ui:param name="compType" value="single" />
			
			<ui:param name="compBean1Id" value="className" />
			<ui:param name="compBean1Lable" value="事件类名" />
			
			<ui:define name="compBean1Content">
				 <sinox:inputText id="#{compBean1Id}" value="#{eventObject.className}" />
			</ui:define>
		</ui:decorate>
		
		<!-- 第三行 -->
		<ui:decorate template="/layout/input/editable-2c-custom-template.xhtml">
			<ui:param name="compType" value="single-all" />
			
			<ui:param name="compBean1Editable" value="false" />
			<ui:param name="compBean1Id" value="parameters" />
			<ui:param name="compBean1Lable" value="" />
			
			<ui:define name="compBean1Content">
				<p:toolbar height="22px" styleClass="sino-toolbar-on-datatable">
					<p:toolbarGroup align="left">
				    	<div style="float:left;">
				    		<p:spacer width="10" height="25" />
				    	</div>
				    	<div style="float:left;margin-top:5px;">
				    		<h:outputText value="参数列表"/>
				    	</div>
				    </p:toolbarGroup>
				    
				    <p:toolbarGroup align="right">
				    	<p:commandButton title="添加" value="添加"
							actionListener="#{bpmAction.addAwokeAction}"
							update="#{compBean1Id}">
							<h:inputHidden value="#{commonContentViewBean.id}" />
							<h:inputHidden value="#{eventObjectIndex}" />
						</p:commandButton>
						
						<p:commandButton title="删除" value="删除"
							actionListener="#{bpmAction.removeAwokeAction}"
							update="#{compBean1Id}">
							<h:inputHidden value="#{commonContentViewBean.id}" />
							<h:inputHidden value="#{eventObjectIndex}" />
						</p:commandButton>
				    </p:toolbarGroup>
				</p:toolbar>
				
				<p:dataTable id="#{compBean1Id}" var="af" value="#{eventObject.parameters}"
			        emptyMessage="请添加事件参数" selectionMode="multiple" rowIndexVar="afvar"
			        selection="#{eventObject.selectedRows}">
			  		
			  		<p:column headerText="序号" style="width:20px;">
			  			<h:outputText value="#{afvar + 1}"/>
					</p:column>
					
					<p:column headerText="参数类型" style="width:150px;">
						<p:cellEditor>  
			                <f:facet name="output">  
			                    <h:outputText value="#{af.type}" />  
			                </f:facet>  
			                <f:facet name="input">  
			                    <sinox:selectOneRadio id="#{compBean1Id}" value="#{af.type}"
									items="#{bpmSelectItemsService.items.parameterType}" />
			                </f:facet>
			            </p:cellEditor>
					</p:column>
					
					<p:column headerText="名称" style="width:150px;">
						<p:cellEditor>  
			                <f:facet name="output">  
			                    <h:outputText value="#{af.name}" />  
			                </f:facet>  
			                <f:facet name="input">  
			                    <h:inputText value="#{af.name}" style="width:100%"/>  
			                </f:facet>
			            </p:cellEditor>
					</p:column>
					
					<p:column headerText="值">
						<p:cellEditor>  
			                <f:facet name="output">  
			                    <h:outputText value="#{af.value}" />  
			                </f:facet>  
			                <f:facet name="input">  
			                    <h:inputText value="#{af.value}" style="width:100%"/>  
			                </f:facet>
			            </p:cellEditor>
					</p:column>
			  		
			  		<p:column headerText="编辑" style="width:20px;">  
			            <p:rowEditor />
			        </p:column>
			    </p:dataTable>
			</ui:define>
		</ui:decorate>
		
	</ui:decorate>
</ui:composition>